<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //定义数组
      let arr = ['老赵', '老李', '小传', '小黑']
      //调用Math函数将随机数字赋予index
      let index = Math.floor(Math.random() * arr.length)
      // console.log(index)
      console.log(arr.splice(index, 1)) //index，为索引
      console.log(arr);
    </script>
  </body>
</html>
